import reConfig from '@/reConfig/index';
import request from '@/utils/request';

/**
 * 调用示例
 * @method request 接收两个参数
 * @request-params: 第一个参数为接口请求前缀 或 一些版本号；
 * @request-params: 第二个参数为请求配置 目前支持: 请求loading (默认false), 请求头类型Content-Type (默认 application/x-www-form-urlencoded;charset=UTF-8)
 */
export const login = params => request(reConfig.apiPrefix, { loading: true, 'Content-Type': 'application/json' }).post('/login', params); //登录
export const imgUpload = params => request(reConfig.apiPrefix, {'Content-Type': 'application/json' }).post('/uploadImg', params); //图片上传


//首页
export const getInfo = params => request(reConfig.apiPrefix, { loading: true, 'Content-Type': 'application/json' }).get('/index', params); //首页数据

//商品管理
export const merchantList = params => request(reConfig.apiPrefix, { loading: true, 'Content-Type': 'application/json' }).get('/lists', params); //列表
export const orderSubmit = params => request(reConfig.apiPrefix, { loading: false, 'Content-Type': 'application/json' }).post('/order/submit', params); //列表

//财务管理
export const rechargeMode = params => request(reConfig.apiPrefix, { loading: true, 'Content-Type': 'application/json' }).get('/cash/rechargeMode', params); //余额充值
export const cashList = params => request(reConfig.apiPrefix, { loading: true, 'Content-Type': 'application/json' }).get('/cash/lists', params); //充值列表
export const cashRecharge = params => request(reConfig.apiPrefix, { loading: true, 'Content-Type': 'application/json' }).post('/cash/recharge', params); //申请余额
export const getAccountLog = params => request(reConfig.apiPrefix, { loading: true, 'Content-Type': 'application/json' }).get('/cash/accountLog', params); //余额明细

//数据统计
export const getData = params => request(reConfig.apiPrefix, { loading: true, 'Content-Type': 'application/json' }).get('/statistics', params); //余额充值

//导码管理
export const getList = params => request(reConfig.apiPrefix, { loading: true, 'Content-Type': 'application/json' }).get('/order/lists', params); //导码列表
export const getDeatil = params => request(reConfig.apiPrefix, { loading: false, 'Content-Type': 'application/json' }).get('/order/codeList', params); //导码详情
export const invalid = params => request(reConfig.apiPrefix, { loading: false, 'Content-Type': 'application/json' }).get('/order/toVoid', params); //作废
export const exportCode = params => request(reConfig.apiPrefix, { loading: false, 'Content-Type': 'application/json' }).post('/order/exportCode', params); //导出券码


//系统管理
export const editPass = params => request(reConfig.apiPrefix, { loading: true, 'Content-Type': 'application/json' }).post('/editPass', params); //修改密码
